package com.spsy.pay.config;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    //public static String app_id = "2021000122669503";


    //arhat
    public static String app_id = "9021000150623708";



    // 商户私钥，您的PKCS8格式RSA2私钥
    //public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDnS97J1eX2pXu+0E0ksZCN9hw8sWUkaXRa2H33JODPOO/YdfOqa64tPLSG/+s82l/gA49Hv5S/29k/ptkBfuPYO9KDDGBZd08No5uqJNUikZG3Cg3f3bcOAv5DhWfDyWLrwAS48Vp5DFCvjhkmrpyQu6nmqEquHARy1zsKLhwy5HyBKAFMJng5oXrP7w7+qALaIGBS8bXfhnRz2rhpe1mZSH5OWPyQUQuUf0Fp5DRJkyuU/x5ebatyvdqX1tuho7nT86nXGDbuI6a6doez//P2zSL3Hg6+E2Jv5m0F6NNwAuLq2ZW8hMvYzQNSj/HtO1+tkCTy1SiEdrTHMYZYnXS7AgMBAAECggEAGPDyfjtFh/pCRMo7d1h6aQR/+P98E5gXhvBPbQYaA9505peZhegEqTYhlWklWbOGoSZhHfCHvsSbQaThQ6sGMLwKsDz2as9Vw/e/gnJkVUzzNJSt+FT1N1qVRnytOsyNkTRsjfDgu6rbTIL7LVOo6GaEJK5DF1FIHYYeBLQCMG6EgdrWnDKxnTcJ+sivvlLR3ea7CKV+utwpJs2PMZ/KvCSZcDWF1qdeq9nDZz236Zjn4KDpHPMpKFOo1rGslKU9AUQZRUp1YpkCYvYjqq5s3numrqwM128jPPjzbAJ5mdICLP0qgrNXyUfmj6vxCZ+zTv87y2mxDNHI0hejHJW3KQKBgQD+pw89OVFHbi+BeASMVTxUtBqDiJIruO9hj0WDmCCZSxEVOXcCz2vuBrtElvzvAVWyzvzQdZZe61JoR6AQ2evnA8K2KRhnCtRiBJak6bOHeH6MjrT6f1yRC4iXHiZd8PPeHb2Noey7MxMvDMPThRcsWtsQ/wbxlQoZXuZDimEWhQKBgQDohSxrSRYcsXwS2h6npZi8pgT1jferdvDECHStONlX8cuMaFiJjyaiWHaaOFQC+sMWZ28Ys1PDXVVOp8lrdhxARBtFIotAsItm6FpNen3+2DKm/LAY3Tv0onwtdjwwJssPtHbdeORouSdXmkqW+nZlk+RlG8etaGJw4lGFO9JiPwKBgBi7Zup+T5uNYwXC/0YV3Sco2s5djDy82Fr0TD8MnlXlCYKzMxDNzmCuvK9brrMTwRv9qGYilXkgh79i/XPFhnjIT7fbY+hWD+x5H5xiqjIFDN1f2sndZsMbiKeMoRNMnJK89rTzvgcsXbebGMXJTkfbhx0ud6Es5W8zXU+/98/1AoGAP/ZCXdDhEEuSge0Wea+H8H0K6DGBa91wJbzdu7jjsNmG0LzzfgOu8QG8vne4RImOmN8jJHxQEnHeQaDOO41mABe8GKyD+euWrVxFWwLTHgODC4R/PJe/InCAEFFyBRzmxw8xk4Lp8hTcybBbzGRhpVelgFq/9ue8DKl1G111ZikCgYB0hKL01AvOH90IZWLgPB6D0CLqEm89PcdfOn4wNje8d+3+Ni/ELsEoxwYeMOdtKf6+xun4V0Pi/EG1cp2AghxUWpbDst4rlFNyCoqq8dRS12UddVA1NqiMoR+EBXo6W7tEt2WLmz3olP9tlaU1nZIphCgjTeL5zHwtiYm2nEyHcA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    //public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkPDPXCJ38XSn1S2YIViz2fgFmaMYEKt+LNxGEu81vB/NDedTcUYHjtxkSs1+WL+MtgsnWJj2pqCUKZ/9DqDuEPyaUmi9nSA+iFJWDYkxbzwQm0xVNorkwELAvcjATOkjh8ld4hfMC515RzOJTTf1Xk2O13eDVT/4W1oWu1KA34QmDZqjJxBzdR8q9FEPDzhAtiOVIILI3IrwvVqQX8IZYPIBdcGibaytNrAplp70dGOjgVoRD8QToAQA5+MA0T2lAzDPn5wLH1VQAatRdAsUlSrmsYDQUVid2LDWOJG0Ue4a0iNkF7LOqPz3zLVm1mJEHeTCrlro0h+h+Dut6MqumwIDAQAB";



    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCBj+KqN7dNPs2marqQ8OZ0ZTdNCdT+GBs8hp1gHcpe7h5AMosCsr3F78iQafr62i+a8RikeQbnFj8o07KBKWH0aDSI2S7plRn3RqVax6j5YvE1VAPu0QYxz+yj2F+61aoGCZpLz3ZGNVEj1amLSV788MHqMIzO50zLJhAGycVmnEZbuEeb6mSLRgcPTHDRS8kUi+ZXeVcISp6WXQbqlAIVG9dn8R+oCZMQgzDTY9Fm0mEENMbVStZ44O24P70a/0SULkwpwAZCmvi+vtcNs3IwFU5Z5+P4j2QmcyT1Dg2N6H3IeDQHVpbWLdvyi4aQKiYwqx8VTz/pwpTk2KIcdxvnAgMBAAECggEAGBEwW8pJxJGcBgPhcDcvuANtSGRBKooz1QR0i3w9MXEuMWKyK+gkFHa8XQcy1hJdsXyDxVmuDJM3XFAm4pNbXNlWmO0vJ7jIwARhhwF7xAe7ItreeChf7DThknYJIl26XbC+9sItCFGzJuLzwan5eScH/obSQUT6IOqLI5erkanF8cdLUcYvac0gAqFgiSnULCg00l1WEeiN2RiDlQShXtRVmR/benePZQUUI166WjwEGuevxZf8uMBvB/FibNqa/s1R+RA61gE+KtvBXxe6bcE2wFwqGi1zW57iBxKRQDQKkeyijQNavp1vKZHDF6Gqq/fW+/V4gry1DAHCgurpQQKBgQDJEn5IT5rnEmfjtNHwfksO52WhrBJ+tSoTulUVb8sgZQov0z+F8z8VYPzuHwwTRRogb0nHgLK7om2fvyyFkU16nVZyhCShtd4xINd7Gb/BQWFlgz+1YERpMYv/meloj8viX8FgUH1Qs7+2qw+3wBtK/YuNA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9yHg0B1aW1i3b8ouGkComMKsfFU8/6cKU5NiiHHcb5wIDAQAB";





    // 用来接收支付结果（异步回调路径）
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    // public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://y6ac7c43.natappfree.cc/alipay/pay";

    // 支付完成之后的跳转路径（同步回调路径）
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost/paysuccess.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
